#!/bin/sh
errorExit() {
    echo "*** $*" 1>&2
    exit 1
}

curl --silent --max-time 2 --insecure https://localhost:{{ .controlPlaneEndpointPort }}/ -o /dev/null || errorExit "Error GET https://localhost:{{ .controlPlaneEndpointPort }}/"
if ip addr | grep -q {{ .vip }}; then
    curl --silent --max-time 2 --insecure https://{{ .vip }}:{{ .controlPlaneEndpointPort }}/ -o /dev/null || errorExit "Error GET https://{{ .vip }}:{{ .controlPlaneEndpointPort }}/"
fi